import React, { Component } from "react";

import Search from "./components/Search";
import List from "./components/List";
import "./app.css";

export default class App extends Component {
  state = {
    loading: false,
    isFirstLoad: true,
    err: "",
    list: []
  };
  updateAppState = stateObj => {
    this.setState(stateObj);
  };

  render() {
    const { isFirstLoad } = this.state;
    return (
      <div className="container">
        <Search
          isFirstLoad={isFirstLoad}
          updateAppState={this.updateAppState}
        />
        <List {...this.state} />
      </div>
    );
  }
}
